/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.aseo.model.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author usuario
 */
@Entity
@Table(name = "tipo_media")
public class TipoMedia implements Serializable {
    private static final long serialVersionUID = 1L;
    
    public static final TipoMedia IMAGEN = new TipoMedia(1L, "Imagen");
    public static final TipoMedia VIDEO = new TipoMedia(2L, "Video");
    
    @Id
    @Basic(optional = false)
    @Column(name = "id_tipo_media")
    private Long idTipoMedia;
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(mappedBy = "idTipoMedia")
    private List<ReclamoMedia> reclamoMediaCollection;
    @OneToMany(mappedBy = "idTipoMedia")
    private List<SupervisionMedia> supervisionMediaCollection;

    public TipoMedia() {
    }
    
    public TipoMedia(Long idTipoMedia, String descripcion) {
    	setIdTipoMedia(idTipoMedia);
    	setDescripcion(descripcion);
    }

    public TipoMedia(Long idTipoMedia) {
        this.idTipoMedia = idTipoMedia;
    }

    public Long getIdTipoMedia() {
        return idTipoMedia;
    }

    public void setIdTipoMedia(Long idTipoMedia) {
        this.idTipoMedia = idTipoMedia;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public List<ReclamoMedia> getReclamoMediaCollection() {
        return reclamoMediaCollection;
    }

    public void setReclamoMediaCollection(List<ReclamoMedia> reclamoMediaCollection) {
        this.reclamoMediaCollection = reclamoMediaCollection;
    }

    public List<SupervisionMedia> getSupervisionMediaCollection() {
        return supervisionMediaCollection;
    }

    public void setSupervisionMediaCollection(List<SupervisionMedia> supervisionMediaCollection) {
        this.supervisionMediaCollection = supervisionMediaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipoMedia != null ? idTipoMedia.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoMedia)) {
            return false;
        }
        TipoMedia other = (TipoMedia) object;
        if ((this.idTipoMedia == null && other.idTipoMedia != null) || (this.idTipoMedia != null && !this.idTipoMedia.equals(other.idTipoMedia))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.aseo.model.entity.TipoMedia[idTipoMedia=" + idTipoMedia + "]";
    }

}
